<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Flashgame
 * @version    $Id: manifest.php 6898 2010 YouNet Development $
 * @author     To Anh
 */
return array(
  // Package -------------------------------------------------------------------
  'package' => array(
    'type' => 'module',
    'name' => 'flashgame',
    'version' => '4.02p2',
    'path' => 'application/modules/Flashgame',
    'repository' => 'socialengine.net',
    'title' =>'Social Games',
    'author'=>'YouNet Company',
    'meta' => array(
      'title' => 'Games',
      'description' => 'Games',
      'author' => 'YouNet Company',
      'changeLog' => array(
      ),
    ),
    'actions' => array(
       'install',
       'upgrade',
       'refresh',
       'enable',
       'disable',
     ),
    'callback' => array(
      'path' => 'application/modules/Flashgame/settings/install.php',
      'class' => 'Flashgame_Installer',
    ),
    'directories' => array(
      'application/modules/Flashgame',
    ),
    'files' => array(
      'application/languages/en/flashgame.csv',
    ),
  ),
  // Hooks ---------------------------------------------------------------------
  'hooks' => array(
    array(
      'event' => 'onStatistics',
      'resource' => 'Flashgame_Plugin_Core'
    ),
    array(
      'event' => 'onUserDeleteBefore',
      'resource' => 'Flashgame_Plugin_Core',
    ),
  ),
  // Items ---------------------------------------------------------------------
    'items' => array(
    'flashgame',
    'flashgame_param',
    'flashgame_feature'
  ),
  // Routes --------------------------------------------------------------------
  'routes' => array(
    'flashgame_extended' => array(
      'route' => 'games/:controller/:action/*',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'index',
      ),
      'reqs' => array(
        'controller' => '\D+',
        'action' => '\D+',
      )
    ),
    // Public
    'flashgame_browse' => array(
      'route' => 'games/browse/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'index',
        'page' => 1
      )
    ),

    'flashgame_index_userratings' => array(
      'route' => 'games/userratings',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'userratings'
      )
    ),
    'flashgame_view' => array(
      'route' => 'games/:user_id/*',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'list'
      ),
      'reqs' => array(
        'user_id' => '\d+'
      )
    ),
    'flashgame_entry_view' => array(
      'route' => 'games/:user_id/:flashgame_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'view'
      ),
      'reqs' => array(
        'user_id' => '\d+',
        'flashgame_id' => '\d+'
      )
    ),
    
    // User
    'flashgame_create' => array(
      'route' => 'games/create',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'create'
      )
    ),
    'flashgame_delete' => array(
      'route' => 'games/delete/:flashgame_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'delete'
      )
    ),
    'flashgame_upgrade' => array(
      'route' => 'games/upgrade',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'package',
        'action' => 'upgrade'
      )
    ),    
    'flashgame_payment' => array(
      'route' => 'games/payment',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'paypal',
        'action' => 'payment'
      )
    ),   
    'flashgame_payment_request' => array(
      'route' => 'games/payment/request/:package_id/:user_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'paypal',
        'action' => 'request'
      )
    ),    
    'flashgame_payment_get' => array(
      'route' => 'games/payment/get/:package_id/:user_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'paypal',
        'action' => 'get'
      )
    ),        
    'flashgame_paymenthistory' => array(
      'route' => 'games/paymenthistory',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'paypal',
        'action' => 'paymenthistory'
      )
    ), 
   'flashgame_userpackages' => array(
      'route' => 'games/userpackages',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'package',
        'action' => 'userpackages'
      )
    ),
    'flashgame_close' => array(
      'route' => 'games/close/:flashgame_id/:closed/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'close',
        'level_id' => 1
      )
    ),
    'flashgame_admin_manage' => array(
      'route' => 'admin/games/manage/:action/*',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-manage',
        'action' => 'index',
        'level_id' => 1
      )
    ),
  
    
    'admin_payment_clients' => array(
      'route' => 'admin/games/clients/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-payment',
        'action' => 'clients',
        'level_id' => 1,
        'page' => 1       
      )
    ),     
    
    'flashgame_admin_payment' => array(
      'route' => 'admin/games/payment',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-payment',
        'action' => 'settings',
        'level_id' => 1
      )
    ),     
  'flashgame_admin_settings' => array(
      'route' => 'admin/games/settings',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-settings',
        'action' => 'index',
        'level_id' => 1
      )
    ),      
    'flashgame_admin_categories' => array(
      'route' => 'admin/games/categories',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-categories',
        'action' => 'categories',
        'level_id' => 1
      )
    ),  
  'flashgame_admin_package' => array(
      'route' => 'admin/games/package',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'index',
        'level_id' => 1
      )
    ),    
    
  'flashgame_admin_level' => array(
      'route' => 'admin/games/level',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-level',
        'action' => 'index',
        'level_id' => 1
      )
    ),
        
    'flashgame_paid' => array(
      'route' => 'games/paid/:flashgame_id/:paid/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-manage',
        'action' => 'paid'
      )
    ),
    
    'flashgame_rate' => array(
      'route' => 'games/rate/:flashgame_id/:rates',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'rate'
      )
    ),    
    
    'flashgame_paid_level' => array(
      'route' => 'admin/games/paidlevel/:flashgame_id/:level/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-manage',
        'action' => 'paidlevel'
      )
    ),
    
    'flashgame_edit' => array(
      'route' => 'games/edit/:flashgame_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'edit'
      )
    ),
    'flashgame_manage' => array(
      'route' => 'games/manage/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'manage',
        'page' => '1'
      )
    ), 
    

    'flashgame_success' => array(
      'route' => 'games/success/:flashgame_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'success'
      )
    ),
    'flashgame_style' => array(
      'route' => 'games/flashgamestyle',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'flashgamestyle'
      )
    ),

    'flashgame_tag' => array(
      'route' => 'games/tag',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'index',
        'action' => 'suggest'
      )
    ),
    // Admin
    /*
    'flashgame_admin' => array(
      'route' => 'admin/flashgame/:action',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin',
        'action' => 'index'
      ),
      'reqs' => array(
        //'action' => '[^(level)]'
      )
    ),
     * 
     */
    'flashgame_admin_manage_payment' => array(
      'route' => 'admin/games/payment/settings',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-payment',
        'action' => 'settings',
        'level_id' => 1
      )
    ),

    'flashgame_admin_manage_payment_incomes' => array(
      'route' => 'admin/games/payment/incomes/:client_id/:page',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-payment',
        'action' => 'incomes',
        'level_id' => 1,
        'page' => 1       
      )
    ),      
	'flashgame_admin_manage_level' => array(
      'route' => 'admin/games/level/:level_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-level',
        'action' => 'index',
        'level_id' => 1
      )
    ),
	'flashgame_admin_manage_package_view' => array(
      'route' => 'admin/games/package/view/:package_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'view',
        'level_id' => 1
      )
    ),
    'flashgame_admin_package_packageusers' => array(
      'route' => 'admin/games/package/packageusers/:package_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'packageusers',
        'level_id' => 1
      )
    ),
    'flashgame_admin_package_useredit' => array(
      'route' => 'admin/games/package/useredit/:package_id/:user_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'useredit',
        'level_id' => 1
      )
    ), 
    'flashgame_admin_manage_package_enable' => array(
      'route' => 'admin/games/package/enable/:package_id/:enable',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'enable',
        'level_id' => 1
      )
    ),   
    'flashgame_admin_manage_package_edit' => array(
      'route' => 'admin/games/package/edit/:package_id',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'edit',
        'level_id' => 1
      )
    ),
    
    'flashgame_admin_manage_package_create' => array(
      'route' => 'admin/games/package/create',
      'defaults' => array(
        'module' => 'flashgame',
        'controller' => 'admin-package',
        'action' => 'create',
        'level_id' => 1
      )
    ),  

  
  ),
);
